package strategy;

/**
 * 返利收费
 */
public class CashReturn implements CashStrategy {
    private double moneyCondition = 0.0;
    private double moneyReturn = 0.0;

    public CashReturn(double moneyCondition, double moneyReturn) {
        this.moneyCondition = moneyCondition;
        this.moneyReturn = moneyReturn;
    }

    @Override
    public double calculateCash(double money) {
        return money - Math.floor(money / moneyCondition) * moneyReturn;
    }
}
